package com.gaga.console.core.entity.dto;

import com.gaga.common.enums.AudioPlayType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 话术vo
 * </p>
 *
 * @author liujia
 * @since 2022-05-19
 */
@Data
@ApiModel("配置请求参数")
public class ConfigDto implements Serializable {

    @ApiModelProperty("sseChannelId")
    @NotNull
    private String sseChannelId;

    @ApiModelProperty("fileDirectory")
    @NotNull
    private FileDirectory fileDirectory;

    @ApiModelProperty("选择的音频输出设备")
    @NotNull
    private String outMediaDevice;

    @ApiModelProperty("音频播放设置")
    @NotNull
    private AudioSetting audioSetting;

    @ApiModelProperty("模型设置")
    @NotNull
    private ModelSetting modelSetting;

    @ApiModelProperty("插播音频设置")
    @NotNull
    private InsertAudioSetting insertAudioSetting;

    @ApiModelProperty("主音频智能回复设置")
    @NotNull
    private MainAudioSetting mainAudioSetting;

    @ApiModelProperty("插入音频设置")
    @NotNull
    private OpenBaseSetting userEnterSetting;

    @ApiModelProperty("关键字设置")
    @NotNull
    private KeywordSetting keywordSetting;

    @ApiModelProperty("随机音频设置")
    @NotNull
    private OpenBaseSetting randomAudioSetting;

    @ApiModelProperty("ai配置")
    @NotNull
    private AISetting aiSetting;

    @ApiModelProperty("智能回复配置")
    @NotNull
    private SmartReplySetting smartReplySetting;

    @ApiModelProperty("黑名单配置")
    private BlackListSetting blackListSetting;

    @Data
    public static class BlackListSetting implements Serializable {

        private String blackList;
    }

    @Data
    public static class AudioSetting implements Serializable {

        private AudioGenSetting audioGen;

        private AudioPlaySetting play;

        private VolumeSetting volume;

        private Equalizer equalizer;
    }

    @Data
    public static class Equalizer implements Serializable {
        /**
         * 均衡器设置
         */
        private List<Float> list;
    }

    @Data
    public static class AudioGenSetting implements Serializable {

        /**
         * 最大音频字数长度
         */
        private Integer maxCharLength;
    }

    @Data
    public static class VolumeSetting implements Serializable {

        /**
         * 主播音量
         */
        private Integer anchor;

        /**
         * 助手音量
         */
        private Integer assistant;

        /**
         * 本地音量
         */
        private Integer local;
    }

    @Data
    public static class AudioPlaySetting implements Serializable {

        /**
         * 主播播放设置
         */
        private AudioPlayBaseSetting anchor;

        /**
         * 小助理播放设置
         */
        private AudioPlayBaseSetting assistant;
    }

    @Data
    public static class AudioPlayBaseSetting implements Serializable {

        /**
         * 主播音量
         */
        private AudioPlayType type;

        /**
         * 随机最小音量
         */
        private Integer min;

        /**
         * 随机最大音量
         */
        private Integer max;

        /**
         * 固定音量
         */
        private Integer speed;
    }

    @Data
    public static class ModelSetting implements Serializable {

        /**
         * 主播模型名称
         */
        private String anchor;

        /**
         * 助手模型名称
         */
        private String assistant;

//        private Integer topK;
//
//        private Double topP;
//
//        private Double speedFactor;
//
//        private Double repetitionPenalty;
//
//        private Double temperature;
//
//        private Long seed;
    }

    @Data
    public static class InsertAudioSetting implements Serializable {

        /**
         * anchor、assistant
         */
        private String type;
    }

    @Data
    public static class MainAudioSetting implements Serializable {

        /**
         * 主音频播放间隔
         */
        private Integer intervalMin;

        /**
         * 主音频播放间隔
         */
        private Integer intervalMax;
        /**
         * 智能回复配置
         */
        private SmartReplyOpenSetting smartReply;
    }


    @Data
    public static class KeywordSetting extends OpenBaseSetting implements Serializable {

        /**
         * 复读问题开关
         */
        private Boolean repeatProblem;

        /**
         * 智能问答
         */
        private Boolean openSmartQA;
    }

    @Data
    public static class OpenBaseSetting implements Serializable {

        /**
         * 开关
         */
        private Boolean open;

        /**
         * anchor、assistant
         */
        private String type;

        /**
         * anchor、assistant
         */
        private Integer startTime;

        /**
         * anchor、assistant
         */
        private Integer endTime;

        /**
         * 智能回复配置
         */
        private SmartReplyOpenSetting smartReply;
    }

    @Data
    public static class SmartReplySetting implements Serializable {

        /**
         * 开关
         */
        private Boolean open;

        /**
         * 复读问题
         */
        private Boolean repeatProblem;

        /**
         * anchor、assistant
         */
        private Integer startTime;

        /**
         * anchor、assistant
         */
        private Integer endTime;

        /**
         * 主播姓名
         */
        private String anchorName;

        /**
         * 用户称呼
         */
        private String userCallName;
    }

    @Data
    public static class AISetting implements Serializable {

        /**
         * 智能回复模型id
         */
        private Long modelId;

        /**
         * 润色模型的token
         */
        private String token;

        /**
         * 屏蔽词
         */
        private String blockWords;

        /**
         * 直播间描述
         */
        private String liveRoomDesc;
    }

    @Data
    public static class FileDirectory implements Serializable {

        /**
         * 直播间描述
         */
        private Long categoryId;
    }

    @Data
    public static class SmartReplyOpenSetting implements Serializable {

        /**
         * 是否打开智能润色
         */
        private Boolean open;
    }

}
